package su.NewFeatureType;
import iitb.CRF.DataSequence;
import iitb.Model.Edge;
import iitb.Model.FeatureGenImpl;
import iitb.Model.FeatureImpl;
import iitb.Model.FeatureTypes;
import su.Ner.NerDataSequence;


@SuppressWarnings("serial")
public abstract class TransitionFeatures extends FeatureTypes {

	public int maxFeatureNum;
	String fname;
	int tokenId;
	EdgeIter edgeIter;
	
	public TransitionFeatures(FeatureGenImpl fgen,int _baseId,int _maxFeatureNum) {
		super(fgen);
		baseId=_baseId;
		maxFeatureNum=_maxFeatureNum;
	}

	@Override
	public boolean hasNext() {
		if (edgeIter != null && edgeIter.hasNext())
		return true;
	return false;
	}	

	@Override
	public void next(FeatureImpl f) {
		
		Edge e = edgeIter.next();
		f.strId.init(  baseId-(NerDataSequence.labelNum*NerDataSequence.labelNum*tokenId+e.start*NerDataSequence.labelNum+e.end)  , e.end,
				fname+"."+e.start);
		f.yend = e.end;
		f.ystart = e.start;
		f.val = 1;
	}


}
